﻿using Microsoft.Devices;
using Microsoft.Phone.Controls;
using NdefLibrary.Ndef;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Navigation;
using Windows.Networking.Proximity;

namespace ReadWriteNFCTagWP
{
    public partial class Page1 : PhoneApplicationPage, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private enum PageState
        {
            QRCode,
            Write
        }
        private PageState pageState = PageState.Write;

        public Page1()
        {
            InitializeComponent();
            DataContext = this;

        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            goToState(pageState);
        }

        private void notifyPropertyChanged(string property)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }

        private void goToState(PageState state)
        {
            Dispatcher.BeginInvoke(() =>
            {
                if (VisualStateManager.GoToState(this, state.ToString(), true))
                {
                    pageState = state;
                    switch (pageState)
                    {
                        case PageState.QRCode:
                            break;
                    }
                }
            });
        }

    }
}